<!doctype html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>缤格</title>
    <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/style.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/swiper.min.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/common.css"/>
    <link rel="stylesheet" type="text/css" href="../../css/binge.css"/>
    <script type="text/javascript" src="../../script/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="../../script/swiper.min.js"></script>
    <script type="text/javascript" src="../../script/mobile.js"></script>
    <script type="text/javascript">
        window['adaptive'].desinWidth = 750;
        window['adaptive'].baseFont = 28;
        window['adaptive'].maxWidth = 750;
        window['adaptive'].init();
    </script>
</head>

<body>
<!-- header -->
<div id="header">
    <div class="header">
        <div class="head-back">
            <a href="javascript:void(0);" tapmode onclick="comeBack()" class="back-btn"></a>
        </div>
        <div class="head-title">
            <h6 id="headTitle">发布观点</h6>
        </div>
        <!--<div class="head-action">-->
            <!--<a href="javascript:void(0);" tapmode class="action-btn"></a>-->
        <!--</div>-->
    </div>
</div>
<!-- header end -->

<div class="topic-section">
    <div class="viewpoint">
        <textarea name="" id="content" cols="30" rows="10" placeholder="请输入您的观点"></textarea>
    </div>

    <div class="common-fixed-bottom">
        <a href="javascript:void(0);" topmode onclick="release()" class="fixed-bottom">确定</a>
    </div>
</div>


</body>

</html>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript" src="../../script/common.js"></script>
<script type="text/javascript">

    var discuss_id = '';//话题id
    apiready = function () {

        setFixStatusBar(); //设置状态栏
        keybackListener()
        discuss_id = api.pageParam.discuss_id;

    }

    //发布观点
    function release() {
        var param = {
            token: $api.getStorage('token'),
            discuss_id: discuss_id,
            content: $("#content").val(),
        }
        if (!isDefine(param.content)) {
            pop.notice('请输入您的观点');
            return;
        }
        pop.loading()
        getAjax(Interface.discuss_vote, param, function (res) {

            api.sendEvent({
                name: 'viewpoint',
                extra: {}
            });
            pop.notice(res.msg);
            pop.close()
            setTimeout(function () {
                comeBack();
            },2000)
        }, function (error) {
            pop.notice(error.msg)
            pop.close()
            setTimeout(function () {
                comeBack();
            },2000)
        })
    }


</script>
